package org.itzheng.itplayer;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import androidx.annotation.Nullable;

/**
 * APP入口
 * 调用启动页后，进入主界面
 */
public class AppSplashActivity extends org.itzheng.and.activity.SplashActivity {
    private static final String TAG = "AppSplashActivity";

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        boolean fromManifest = isFromManifest(getIntent());
        Log.w(TAG, "onCreate: fromManifest:" + fromManifest);
        if (fromManifest) {
            if (MainActivity.isRunning) {
                //MainActivity 已经在运行了，就不再执行
                finish();
                return;
            }
            App.getInstance().init();
            startActivity(new Intent(this, MainActivity.class));
            finish();
        } else {
            showSplash();
        }
    }
}
